package com.dimension.controller.admin;

import cn.hutool.core.map.MapUtil;
import com.dimension.entity.Admin;
import com.dimension.utils.JsonResultOutputUtil;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet(name = "Test", value = "/")
public class Test extends BaseAdminServlet{
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        List<Admin> adminList = adminService.getAll();

        JsonResultOutputUtil.outputJsonResult(resp, MapUtil.builder()
                .put("adminList", adminList).build());
    }
}
